//package a02;
//
//import java.io.FileInputStream;
//import java.util.LinkedList;
//import java.util.List;
//
//import javax.xml.stream.XMLEventReader;
//import javax.xml.stream.XMLInputFactory;
//import javax.xml.stream.events.EndElement;
//import javax.xml.stream.events.XMLEvent;
//
//public class StAXTournamentReader extends TournamentReader {
//    public static XMLEventReader createEventReader(String fileName)
//	    throws Exception {
//	return XMLInputFactory.newInstance().createXMLEventReader(
//		new FileInputStream(fileName), "utf8");
//    }
//
//    @Override
//    public List<TournamentPlayer> read(String fileName) throws Exception {
//	XMLEventReader reader = createEventReader(fileName);
//	String currentText = null;
//	String name = null;
//	String desc = null;
//	String pl = null;
//	List<TournamentPlayer> result = new LinkedList<TournamentPlayer>();
//
//	while (reader.hasNext()) {
//	    XMLEvent n = reader.nextEvent();
//
//	    if (n.isStartElement()) {
//		currentText = "";
//	    } else if (n.isCharacters()) {
//		currentText = currentText + n.asCharacters().getData();
//	    } else if (n.isEndElement()) {
//		final EndElement ee = n.asEndElement();
//		final String en = ee.getName().getLocalPart();
//		if (en.equals("author")) {
//		    name = currentText;
//		} else if (en.equals("description")) {
//		    desc = currentText;
//		} else if (en.equals("class")) {
//		    pl = currentText;
//		} else if (en.equals("player")) {
//		    result.add(new TournamentPlayer(name, desc, pl));
//		    name = null;
//		    desc = null;
//		    pl = null;
//		}
//	    }
//	}
//	return result;
//    }
//}
